package com.hb.trade.api.push.controller;

import com.hb.core.pojo.center.au.entity.User;
import com.hb.trade.client.center.UserClient;
import io.swagger.annotations.Api;
import lombok.extern.slf4j.Slf4j;
import org.fzzn.core.model.msg.Message;
import org.fzzn.core.model.msg.ResponseDto;
import org.fzzn.core.util.ResultUtil;
import org.fzzn.core.web.anno.Version;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Slf4j
@Version(1.0)
@Api(tags = {"数据推送测试controller"})
@RequestMapping("/{version}")
@RestController
public class TestController {

    protected final UserClient userClient;

    public TestController(UserClient userClient) {
        this.userClient = userClient;
    }

    @PostMapping("/push/testUser")
    public ResponseDto testUser() {
        Message<User> client = userClient.getByUserId(1L);
        return ResultUtil.msg(client);
    }
}
